placesview: Keep up with GLib deprecations
authorMatthias Clasen <mclasen@redhat.com>
Fri, 31 Jul 2020 16:18:54 +0000 (12:18 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 31 Jul 2020 16:54:57 +0000 (12:54 -0400)
We were using deprecated GBookmarkFile api here too.

gtk/gtkplacesview.c

index cdf88ae97435b44024854d807ea6dd5945bb404c..f861c0ec58c174c1b4402900ea44ae1ea2f974b7 100644 (file)
@@ -278,6 +278,7 @@ server_list_add_server (GtkPlacesView *view,
   GError *error;
   char *title;
   char *uri;
+  GDateTime *now;
 
   error = NULL;
   bookmarks = server_list_load (view);
@@ -295,7 +296,9 @@ server_list_add_server (GtkPlacesView *view,
   title = g_file_info_get_attribute_as_string (info, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME);
 
   g_bookmark_file_set_title (bookmarks, uri, title);
-  g_bookmark_file_set_visited (bookmarks, uri, -1);
+  now = g_date_time_new_now_utc ();
+  g_bookmark_file_set_visited_date_time (bookmarks, uri, now);
+  g_date_time_unref (now);
   g_bookmark_file_add_application (bookmarks, uri, NULL, NULL);
 
   server_list_save (bookmarks);